import axios from 'axios'
let service = axios.create({
  // baseURL如果你开启了代理，则注释掉，有协议和域名的请求，不会走代理
  // baseURL: 'https://api.iynn.cn/film',
  timeout: 10000
})
// 响应拦截器
service.interceptors.response.use(response => {
  return response.data
}, err => {
  return Promise.reject('出错啦!!!')
})

export const get = url => service.get(url)
export const post = (url, data = {}) => service.post(url, data)
